<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户角色列表</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<div class="wrapper wrapper-content">
		<div class="ibox">
			<div class="ibox-title">
				<h5>用户角色列表 </h5>
			</div>
			<div class="ibox-content">

			<sys:message content="${message}"/>

			<!-- 查询条件 -->
			<div class="row">
				<div class="col-sm-12">
					<form:form id="searchForm" modelAttribute="sysUserrole" action="${ctx}/system/sysUserrole/" method="post" class="breadcrumb form-inline">
						<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
						<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>

							<div class="form-group"><span>角色ID：</span>
								<form:input path="roleid" htmlEscape="false" maxlength="32" class="form-control input-mini"/>
							</div>
							<div class="form-group"><span>用户ID：</span>
								<form:input path="userid" htmlEscape="false" maxlength="32" class="form-control input-mini"/>
							</div>

						<div class="form-group">
                            <button  class="btn btn-primary btn-sm " onclick="search()" ><i class="fa fa-search"></i> 查询</button>
                            <button  class="btn btn-primary btn-sm " onclick="reset()" ><i class="fa fa-refresh"></i> 重置</button>
                        </div>
					</form:form>
				</div>
			</div>

			<!-- 工具栏 -->
            <div class="row">
                <div class="col-sm-12">
                    <div class="pull-left">
                        <shiro:hasPermission name="system:sysUserrole:edit">
                            <table:addRow url="${ctx}/system/sysUserrole/form" title="用户角色" ></table:addRow><!-- 增加按钮 -->

                            <table:editRow url="${ctx}/system/sysUserrole/form" title="用户角色" id="contentTable" ></table:editRow><!-- 编辑按钮 -->

                            <table:delRow url="${ctx}/system/sysUserrole/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->

                            <table:importExcel url="${ctx}/system/sysUserrole/import"></table:importExcel><!-- 导入按钮 -->

                            <table:exportExcel url="${ctx}/system/sysUserrole/export"></table:exportExcel><!-- 导出按钮 -->
                        </shiro:hasPermission>
                       <button class="btn btn-white btn-sm " data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i> 刷新</button>

                    </div>
                </div>
            </div>


            <table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
                <thead>
                    <tr>
                        <shiro:hasPermission name="system:sysUserrole:edit"><th>操作</th></shiro:hasPermission>
                    </tr>
                </thead>
                <tbody>
                <c:forEach items="${page.list}" var="sysUserrole">
                    <tr>
                        <td>
                        <shiro:hasPermission name="system:sysUserrole:view">
                            <a href="#" onclick="openDialogView('查看用户角色', '${ctx}/system/sysUserrole/form?id=${sysUserrole.id}','800px', '500px')" class="btn btn-info btn-xs" title="查看"><i class="fa fa-search-plus"></i> 查看</a>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="system:sysUserrole:edit">
                            <a href="#" onclick="openDialog('修改用户角色', '${ctx}/system/sysUserrole/form?id=${sysUserrole.id}','800px', '500px')" class="btn btn-success btn-xs" title="修改"><i class="fa fa-edit"></i><span class="hidden-xs">修改</span></a>
                        </shiro:hasPermission>

                        <shiro:hasPermission name="system:sysUserrole:del">
                            <a href="${ctx}/system/sysUserrole/delete?id=${sysUserrole.id}" onclick="return confirmx('确认要删除该用户角色吗？', this.href)" class="btn  btn-danger btn-xs" title="删除"><i class="fa fa-trash"></i><span class="hidden-xs">删除</span></a>
                        </shiro:hasPermission>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>

            <table:page page="${page}"></table:page>
			</div>
		</div>
	</div>
</body>
</html>